package com.gosophia.metadataEngine.action;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.gosophia.metadataEngine.dto.DataSourceInfoDto;
import com.gosophia.metadataEngine.ws.MetadataEngineWebService;

/**
 * 转入编辑数据源页面
 * @author wangxinbing
 * @since 2011-5-6
 */
@Controller("ToEditDataSourceInfoAction")
@Scope("prototype")
public class ToEditDataSourceInfoAction {
	private Long dataSourceInfoId;
	
	private DataSourceInfoDto dataSourceinfoDto;
	@Autowired
	private MetadataEngineWebService metadataEngineWebService;

	public Long getDataSourceInfoId() {
		return dataSourceInfoId;
	}

	public void setDataSourceInfoId(Long dataSourceInfoId) {
		this.dataSourceInfoId = dataSourceInfoId;
	}
	
	public DataSourceInfoDto getDataSourceinfoDto() {
		return dataSourceinfoDto;
	}

	public void setDataSourceinfoDto(DataSourceInfoDto dataSourceinfoDto) {
		this.dataSourceinfoDto = dataSourceinfoDto;
	}

	public String execute(){
		dataSourceinfoDto = metadataEngineWebService.findDataSourceInfoById(dataSourceInfoId);
		return "success";
	}
}
